package com.gzq.prototype;

import java.io.IOException;

public class DeepClone {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Gun gun = new Gun();
        Human human = new Human();
        human.setAge(18);
        human.setGun(gun);
        System.out.println(human.hashCode());
        System.out.println(human);
        System.out.println(human.getGun().hashCode());

        System.out.println("=======深度克隆一个人========");

        Human clone = (Human) human.deepClone();
        System.out.println(clone.hashCode());
        System.out.println(clone);
        System.out.println(clone.getGun().hashCode());
    }
}
